package com.cd2cd.code_app.dispatcher;

import com.alibaba.fastjson.JSONObject;

public class ActionType {

    public EventType type;
    public String params;

    public ActionType(String json) {
        JSONObject obj = JSONObject.parseObject(json);
        String type = obj.getString("type");

        this.type = EventType.valueOf(type);
        this.params = obj.getString("params");
    }

    public enum EventType {
        start, // 开始启动程序
        openTab,
        readSetting,
        saveSetting,
        openSetting,
        openInBrowser, // 使用默认浏览器打开管理服务
    }
}
